package com.honeycomb.utils;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.json.simple.JSONObject;

public class ErrorHandler {
	
	protected static Logger errorLogger = LogManager.getLogger("com.honeycomb.utils.ErrorHandler");
	
	@SuppressWarnings("unchecked")
	public static JSONObject createErrorJSONInfo(String errorMsg) {
		JSONObject obj = new JSONObject();
		obj.put("error", 1);
		obj.put("message", errorMsg);
		return obj;
	}
	
	public static void logError(String message, Exception ex) {
		errorLogger.error(message, ex);
	}
	

}
